#include "widget.h"
#include "ui_widget.h"

/*
 *
 *
 * X:140  Y:90
 * W:761  W:501
 *
 * */
Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);



    dataConnect=new StructConnect();
    dataConnect->socket=new QTcpSocket();
    dataConnect->datasend=new Data();
    dataConnect->datarecv=new Data();
    dataConnect->datasend->length=-1;
    dataConnect->datasend->data.resize(65536);
    dataConnect->datarecv->length=-1;
    dataConnect->datarecv->data.resize(65536);

    devconnect=new DevConnect(dataConnect,this);
    pageone=new PageOne(dataConnect,this);
    pagetwo=new PageTwo(dataConnect,this);


    devconnect->move(140,90);
    devconnect->setBaseSize(761,501);

    pageone->move(140,90);
    pageone->setBaseSize(761,501);


    pagetwo->move(140,90);
    pagetwo->setBaseSize(761,501);

    devconnect->show();
    pageone->hide();
    pagetwo->hide();

}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_BtnDevConnect_clicked()
{
    devconnect->show();
    pageone->hide();
    pagetwo->hide();


}

void Widget::on_BtnPage1_clicked()
{
    devconnect->hide();
    pageone->show();
    pagetwo->hide();

}

void Widget::on_BtnPage2_clicked()
{
    devconnect->hide();
    pageone->hide();
    pagetwo->show();

}
